Network Address Translation (NAT), which is a translation technology for translating a private address into a legal Internet Protocol (IP) address, has been widely applied in various types of Internet access methods and various types of networks. NAT enables a plurality of private network computers to share an Internet link, thereby well solving the problem of shortage of resources of public IP addresses.
A Carrier Grade NAT (CGN) device, which is a device deployed in an operator, improves smooth transition from Internet Protocol Version 4 (IPv4) to Internet Protocol Version 6 (IPv6) and promotes an evolution process by integrating a plurality of evolution mechanisms including tunneling and NAT. Translation forms of CGN include: translation from a private network IPv4 address to a public network IPv4 address, translation from a private network IPv4 address to IPv6 address, and translation from IPv6 address to a public IPv4 address, and so on. An independent processing unit is mostly applied in order to improve CGN performance. The processing unit may be a single-core processing unit or a multi-core processing unit. Currently, the multi-core processing unit applies a form of load sharing so as to optimize the performance of a Central Processing Unit (CPU) of the multi-core processing unit.
The load sharing includes load sharing of resources of public network addresses and load sharing of user devices. The resources of the public network addresses may be hashed to different CPUs by a HASH method so that an effect of balanced load sharing is implemented for allocation of the resources of the public network addresses and the user devices. However, relatively high performance is required for a forwarding unit and a processing unit of CGN if hashing is performed by a single public network address resource. If hashing is performed by a fixed public network address block, there is a relatively large performance difference of address translation of CGN because of different numbers of processing units of CGN and different numbers of CPUs included in each processing unit, and there is a problem of poor load sharing.